{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport * as React from 'react';\nimport { getSuccessPercent, validProgress } from './utils';\n/**\n * @example\n *   {\n *     \"0%\": \"#afc163\",\n *     \"75%\": \"#009900\",\n *     \"50%\": \"green\", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'\n *     \"25%\": \"#66FF00\",\n *     \"100%\": \"#ffffff\"\n *   }\n */\nexport const sortGradient = gradients => {\n  let tempArr = [];\n  Object.keys(gradients).forEach(key => {\n    const formattedKey = parseFloat(key.replace(/%/g, ''));\n    if (!isNaN(formattedKey)) {\n      tempArr.push({\n        key: formattedKey,\n        value: gradients[key]\n      });\n    }\n  });\n  tempArr = tempArr.sort((a, b) => a.key - b.key);\n  return tempArr.map(_ref => {\n    let {\n      key,\n      value\n    } = _ref;\n    return `${value} ${key}%`;\n  }).join(', ');\n};\n/**\n * Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and\n * butter, there is the bug. And... Besides women, there is the code.\n *\n * @example\n *   {\n *     \"0%\": \"#afc163\",\n *     \"25%\": \"#66FF00\",\n *     \"50%\": \"#00CC00\", // ====>  linear-gradient(to right, #afc163 0%, #66FF00 25%,\n *     \"75%\": \"#009900\", //        #00CC00 50%, #009900 75%, #ffffff 100%)\n *     \"100%\": \"#ffffff\"\n *   }\n */\nexport const handleGradient = (strokeColor, directionConfig) => {\n  const {\n      from = presetPrimaryColors.blue,\n      to = presetPrimaryColors.blue,\n      direction = directionConfig === 'rtl' ? 'to left' : 'to right'\n    } = strokeColor,\n    rest = __rest(strokeColor, [\"from\", \"to\", \"direction\"]);\n  if (Object.keys(rest).length !== 0) {\n    const sortedGradients = sortGradient(rest);\n    return {\n      backgroundImage: `linear-gradient(${direction}, ${sortedGradients})`\n    };\n  }\n  return {\n    backgroundImage: `linear-gradient(${direction}, ${from}, ${to})`\n  };\n};\nconst Line = props => {\n  const {\n    prefixCls,\n    direction: directionConfig,\n    percent,\n    strokeWidth,\n    size,\n    strokeColor,\n    strokeLinecap = 'round',\n    children,\n    trailColor = null,\n    success\n  } = props;\n  const backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {\n    backgroundColor: strokeColor\n  };\n  const borderRadius = strokeLinecap === 'square' || strokeLinecap === 'butt' ? 0 : undefined;\n  const trailStyle = {\n    backgroundColor: trailColor || undefined,\n    borderRadius\n  };\n  const percentStyle = Object.assign({\n    width: `${validProgress(percent)}%`,\n    height: strokeWidth || (size === 'small' ? 6 : 8),\n    borderRadius\n  }, backgroundProps);\n  const successPercent = getSuccessPercent(props);\n  const successPercentStyle = {\n    width: `${validProgress(successPercent)}%`,\n    height: strokeWidth || (size === 'small' ? 6 : 8),\n    borderRadius,\n    backgroundColor: success === null || success === void 0 ? void 0 : success.strokeColor\n  };\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-outer`\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-inner`,\n    style: trailStyle\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-bg`,\n    style: percentStyle\n  }), successPercent !== undefined ? /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-success-bg`,\n    style: successPercentStyle\n  }) : null)), children);\n};\nexport default Line;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","presetPrimaryColors","React","getSuccessPercent","validProgress","sortGradient","gradients","tempArr","keys","forEach","key","formattedKey","parseFloat","replace","isNaN","push","value","sort","a","b","map","_ref","join","handleGradient","strokeColor","directionConfig","from","blue","to","direction","rest","sortedGradients","backgroundImage","Line","props","prefixCls","percent","strokeWidth","size","strokeLinecap","children","trailColor","success","backgroundProps","backgroundColor","borderRadius","undefined","trailStyle","percentStyle","assign","width","height","successPercent","successPercentStyle","createElement","Fragment","className","style"],"sources":["/data/messenger.client/node_modules/antd/es/progress/Line.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport * as React from 'react';\nimport { getSuccessPercent, validProgress } from './utils';\n/**\n * @example\n *   {\n *     \"0%\": \"#afc163\",\n *     \"75%\": \"#009900\",\n *     \"50%\": \"green\", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'\n *     \"25%\": \"#66FF00\",\n *     \"100%\": \"#ffffff\"\n *   }\n */\nexport const sortGradient = gradients => {\n  let tempArr = [];\n  Object.keys(gradients).forEach(key => {\n    const formattedKey = parseFloat(key.replace(/%/g, ''));\n    if (!isNaN(formattedKey)) {\n      tempArr.push({\n        key: formattedKey,\n        value: gradients[key]\n      });\n    }\n  });\n  tempArr = tempArr.sort((a, b) => a.key - b.key);\n  return tempArr.map(_ref => {\n    let {\n      key,\n      value\n    } = _ref;\n    return `${value} ${key}%`;\n  }).join(', ');\n};\n/**\n * Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and\n * butter, there is the bug. And... Besides women, there is the code.\n *\n * @example\n *   {\n *     \"0%\": \"#afc163\",\n *     \"25%\": \"#66FF00\",\n *     \"50%\": \"#00CC00\", // ====>  linear-gradient(to right, #afc163 0%, #66FF00 25%,\n *     \"75%\": \"#009900\", //        #00CC00 50%, #009900 75%, #ffffff 100%)\n *     \"100%\": \"#ffffff\"\n *   }\n */\nexport const handleGradient = (strokeColor, directionConfig) => {\n  const {\n      from = presetPrimaryColors.blue,\n      to = presetPrimaryColors.blue,\n      direction = directionConfig === 'rtl' ? 'to left' : 'to right'\n    } = strokeColor,\n    rest = __rest(strokeColor, [\"from\", \"to\", \"direction\"]);\n  if (Object.keys(rest).length !== 0) {\n    const sortedGradients = sortGradient(rest);\n    return {\n      backgroundImage: `linear-gradient(${direction}, ${sortedGradients})`\n    };\n  }\n  return {\n    backgroundImage: `linear-gradient(${direction}, ${from}, ${to})`\n  };\n};\nconst Line = props => {\n  const {\n    prefixCls,\n    direction: directionConfig,\n    percent,\n    strokeWidth,\n    size,\n    strokeColor,\n    strokeLinecap = 'round',\n    children,\n    trailColor = null,\n    success\n  } = props;\n  const backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {\n    backgroundColor: strokeColor\n  };\n  const borderRadius = strokeLinecap === 'square' || strokeLinecap === 'butt' ? 0 : undefined;\n  const trailStyle = {\n    backgroundColor: trailColor || undefined,\n    borderRadius\n  };\n  const percentStyle = Object.assign({\n    width: `${validProgress(percent)}%`,\n    height: strokeWidth || (size === 'small' ? 6 : 8),\n    borderRadius\n  }, backgroundProps);\n  const successPercent = getSuccessPercent(props);\n  const successPercentStyle = {\n    width: `${validProgress(successPercent)}%`,\n    height: strokeWidth || (size === 'small' ? 6 : 8),\n    borderRadius,\n    backgroundColor: success === null || success === void 0 ? void 0 : success.strokeColor\n  };\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-outer`\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-inner`,\n    style: trailStyle\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-bg`,\n    style: percentStyle\n  }), successPercent !== undefined ? /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-success-bg`,\n    style: successPercentStyle\n  }) : null)), children);\n};\nexport default Line;"],"mappings":"AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAAC;AACV,CAAC;AACD,SAASW,mBAAmB,QAAQ,oBAAoB;AACxD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,iBAAiB,EAAEC,aA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